{include file="common:meta" /}

<title>游戏管理 - 百人牛牛 - TXCMS_V2</title>
<meta name="keywords" content="">
<meta name="description" content="">
{load href="__STATIC__/admin/layui/dist/css/layui.css"}
</head>
<body>
{include file="common:header" /}

{include file="common:menu" /}

<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> <a href="{:url('index/index')}">首页</a>
        <span class="c-gray en">&gt;</span>
        游戏管理
        <span class="c-gray en">&gt;</span>
        百人牛牛 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a> </nav>
    <div id="tab_demo" class="HuiTab">
        <div class="tabBar clearfix"><span>房间配置</span><span>游戏操作</span></div>
        <div class="tabCon">
            <!--房间配置-->
            <div class="table-responsive">
                <table class="table table-border table-bordered table-bg">
                    <thead>
                    <tr class="text-c">
                        <th width="10">房间ID</th>
                        <th width="40">游戏名</th>
                        <th width="40">级别</th>
                        <th width="40">底分</th>
                        <th width="40">入场限制</th>
                        <th width="40">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr class="text-c">
                        <td>{$room_data.id}</td>
                        <td>{$room_data.game_id}</td>
                        <td>{$room_data.level}</td>
                        <td>
                            {$room_data.bot}
                        </td>
                        <td>{$room_data.stint}</td>
                        <td>
                            <a title="编辑" href="javascript:;" onclick="edit_room_setting('底分入场限制编辑','/admin.php/admin/game_room/bot_edit?id={$room_data.id}','1','800','500')" class="ml-5 btn btn-success-outline radius size-MINI" style="text-decoration:none">配置编辑</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="tabCon">
            <!--游戏配置-->
            <table class="table table-border table-bordered table-bg">
                <thead>
                <tr>
                    <th scope="col" colspan="9">游戏列表</th>
                </tr>
                <tr class="text-c">
                    <th width="40">ID</th>
                    <th width="150">游戏名</th>
                    <th width="90">配置</th>
                    <th width="150">游戏状态</th>
                </tr>
                </thead>
                <tbody>
                <tr class="text-c" style="height: 10px;">
                    <td>{$list_data.id}</td>
                    <td>{$list_data.name}</td>
                    <td>
                        <a style="text-decoration:none" class="btn btn-primary radius size-MINI" onClick="change_setting('修改配置','/admin.php/admin/game_list/changeSetting?id={$list_data.id}','10001','600','270')" href="javascript:;" title="修改配置">修改配置</a>
                    </td>
                    <td style="width: 40px;">
                        <form class="layui-form">
                            <div class="layui-form-item">
                                <div class="layui-input-block" style="margin-left: 0">
                                    <input type="checkbox" lay-skin="switch" {$list_data.status? "checked=''": ""} lay-filter="switch" data-url="{:url('game_list/changeShow',array('id'=>$list_data['id']))}" lay-text="on|off">
                                </div>
                            </div>
                        </form>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</section>
{load href="__STATIC__/admin/layui/dist/layui.all.js"}
<!--{include file="common:footer" /}-->
<!--请在下方写此页面业务相关的脚本-->
<!--{load href="__STATIC__/admin/lib/My97DatePicker/4.8/WdatePicker.js"}-->
<!--{load href="__STATIC__/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"}-->
<!--{load href="__STATIC__/admin/lib/laypage/1.2/laypage.js"}-->
<script type="text/javascript">
    $(function(){ $('#tab_demo').Huitab();});
    /*卡号-编辑*/
    function edit_room_setting(title,url,id,w,h){
        layer_show(title,url,w,h);
    }
    /*
     参数解释：
     title	标题
     url		请求的url
     id		需要操作的数据id
     w		弹出层宽度（缺省调默认值）
     h		弹出层高度（缺省调默认值）
     */

    /*修改配置*/
    function change_setting(title,url,id,w,h){
        layer_show(title,url,w,h);
    }

    layui.use('form', function(){
        var form = layui.form;
        form.on('switch(switch)', function(data) {
            var url = $(this).data('url');
            var status = data.elem.checked;//开关是否开启，true或者false
            //后台我需要的是0或1，所以预先在js中处理change的值
            if(status) {
                status = 1;
            } else {
                status = 0;
            }
            $.post(url, {status: status}, function(res) {
                if(res.code) {
                    layer.msg(res.msg);
                }
            });
        });
    });
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>